﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SelectionDescripteur.aspx.vb" Inherits="OpenDelib.SelectionDescripteur" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <%--<style type="text/css">
        .tree-folder, .tree-folder-open, .tree-file {
            background: url('../images/key_16.png') no-repeat;
        }
    </style>
    <script type="text/javascript">
        function affecterDescripteur() {
            document.getElementById('<%= Me.hfDescripteur.ClientID%>').value = $('#cmbDescripteur').combotree('getValue');
        }
    </script>--%>
    
    <form id="form1" runat="server">
    <div class="popupmargin">
        <div class="errordiv">
            <asp:label ID="lblErreur" runat="server" EnableViewState="false" />
        </div>

        <asp:Label ID="lblDescripteur" runat="server" Text="Descripteur : "></asp:Label>
        <%--<input id="cmbDescripteur" style="width:400px;" />
        <asp:HiddenField ID="hfDescripteur" runat="server" />--%>
        <div style="height:400px; overflow-y:scroll; border:solid 1px black">
            <asp:TreeView ID="tvDescripteurs" runat="server" CollapseImageUrl="~/images/key_minus_20.png"
                ExpandImageUrl="~/images/key_plus_20.png" NoExpandImageUrl="~/images/key_20.png"
                ShowCheckBoxes="All">
            </asp:TreeView>
        </div>

        <div class="popupfixedbuttons" style="text-align: right;">
            <%--<asp:Button ID="btnOK" CssClass="btn" Text="OK" runat="server" OnClientClick="affecterDescripteur();" />--%>
            <asp:Button ID="btnOK" CssClass="btn" Text="OK" runat="server" />
            <input id="btnAnnuler" runat="server" type="button" value="Annuler" class="btn" />
        </div>

    </div>
    </form>

    <script type="text/javascript">
        $("[id*=tvDescripteurs] input[type=checkbox]").bind("click", function () {
            var isChecked = $(this).is(":checked");
            if (!isChecked) return;

            var tv = $("[id*=tvDescripteurs]");
            if (!tv) return;
            if (tv.length <= 0) return;

            var chk = $(this);
            $("input[type=checkbox]", tv).each(function () {
                if ($(this)[0].id == chk[0].id) return;
                $(this).prop('checked', false);
            });
        });

        $("[id*=tvDescripteurs] td").each(function () {
            if ($(this).css('white-space') == 'nowrap') return;
            $(this).css('width', '20px');
        });
    </script>
</body>
</html>
